package com.rong.shop.utils;

import org.springframework.util.DigestUtils;

public class RongUtils {

    public static Boolean operateFlat = true;

    // 输出信息工具
    public static void print(String msg){

        if(operateFlat == true){
            System.err.println("log==>" + msg);
        }

    }

    // MD5 Salt加密
    public static String md5SEncrypt(String password, String salt){

        // 进行三次加密
        for (int i = 0; i < 3; i++) {
            password = DigestUtils.md5DigestAsHex((salt + password + salt).getBytes()).toUpperCase();
        }

        return password;
    }

}
